<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
    <%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
<script type="text/javascript">
function isStudent(obj){
	if("学生" != obj.value){
		document.getElementById("uClass").style.display="none";
	}else{
		document.getElementById("uClass").style.display="inline";
	}
}

function copyContentToPassword(obj){
	document.getElementById("userpassword").value=obj.value;
}
</script>
<style type="text/css">
 td {
     border: 2px solid #C1DAD7;   
    background: #fff;
     font-size:16px;
     padding: 6px 6px 6px 12px;
     color: #4f6b72;
 }
</style>
<link href="../css/common.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<form action="/bookDeviceSys/user/user!addUser.action" method="post">
<table id="mytable" align="center" width="50%">
	<tr>
		<td>用户类型</td>
		<td><select onchange="isStudent(this)" name="user.type">
			<s:iterator value="#request.userTypes">
			<s:if test="value == '学生'">
				<option selected="selected" value="<s:property value="key"/>"><s:property value="value"/></option>
			</s:if>
			<s:else>
				<option value="<s:property value="key"/>"><s:property value="value"/></option>
			</s:else>
			</s:iterator>
		</select></td>
	</tr>
	<tr>
		<td>用户ID</td>
		<td><input type="text" name="user.id" onblur="copyContentToPassword(this)" value="${userVo.id }"></td>
	</tr>
	<tr>
		<td>用户密码</td>
		<td><input type="text" name="user.password" id="userpassword" value="${userVo.password }"></td>
	</tr>
	<tr>
		<td>用户名</td>
		<td><input type="text" name="user.name" value="${userVo.name }"/></td>
	</tr>
	<tr id="uClass" style="display: inline">
		<td>班级</td>
		<td><input type="text" name="user.uclass" value="${userVo.uclass}"></input></td>
	</tr>
	<tr>
		<td colspan="2">
			<input type="submit" value="新增">
		</td>
	</tr>
</table>
</form>
</body>
</html>